import { AxiosRequestConfig } from "axios";
import { AxiosProcessor } from "./processor";

export interface CreaterAxiosOptions extends AxiosRequestConfig {
  prefixUrl?: string;
  transform?: AxiosProcessor;
  requestOptions?: RequestOptions;
}

export interface RequestOptions {
  isParseToJson?: boolean;
  joinPrefix?: boolean;
  apiUrl?: string;
  joinParamsToUrl?: boolean;
}

export interface Result<T = any> {
  code: number;
  type?: "success" | "error" | "warning";
  message: string;
  result?: T;
}
